package com.li.domain;

/**
 * @Author: LiXiang
 * @Description :   前端页面获取对象
 * @Date: Created in 2018/9/9 20:04
 */
public class Result<T> {

    /*返回码*/
    private Integer code;

    /*返回消息*/
    private String msg;

    /*具体数据*/
    private T data;

    public Result(String msg, T data) {
        this.msg = msg;
        this.data = data;
    }

    /**
     * 依据数据生成，使用此构造函数默认成功
     * @param data
     */
    public Result(T data) {
        this.data = data;
    }

    /**
     * 依据消息生成
     * @param msg
     */
    public Result(String msg) {
        this.msg = msg;
    }

    /**
     * 依据错误码生成
     * @param code
     */
    public Result(Integer code) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
